package com.hl.wechat.demo.entity;

import com.hl.wechat.demo.utils.DateUtils;

public class User {
    /**
     * 用户名
     */
    private String userName;

    /**
     * 用户头像地址
     */
    private String profileUrl;

    /**
     * 最后操作时间
     */
    private Long lastTimer;

    private String lastOnLinTimer;

    private boolean isOnline;


    /**
     * 用户唯一ID
     */
    private String id;

    public boolean isOnline() {
        return isOnline;
    }

    public void setOnline(boolean online) {
        isOnline = online;
    }

    public User() {
    }

    public User(String userName, String profileUrl, String id) {
        this.userName = userName;
        this.profileUrl = profileUrl;
        this.id = id;
    }

    public String getLastOnLinTimer() {
        return lastOnLinTimer;
    }

    public void setLastOnLinTimer(String lastOnLinTimer) {
        this.lastOnLinTimer = lastOnLinTimer;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getProfileUrl() {
        return profileUrl;
    }

    public void setProfileUrl(String profileUrl) {
        this.profileUrl = profileUrl;
    }

    public Long getLastTimer() {
        return lastTimer;
    }

    public void setLastTimer(Long lastTimer) {
        this.lastTimer = lastTimer;
        this.lastOnLinTimer= DateUtils.format(lastTimer);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public static User createUserById(String id){
        User user = new User();
        user.setId(id);
        return  user;
    }


}
